# -*- encoding:utf-8 -*-
"""
@作者：ven
@文件名：Request.py
@时间：2021-08-19  10:30
@文档说明:
"""
import requests


class Request():

    def request(self, url, method, **kwargs):
        if method == 'POST':
            return requests.request(url=url, method='POST', **kwargs)
        elif method == 'GET':
            return requests.request(url=url, method='GET', **kwargs)
        elif method == 'DELETE':
            return requests.request(url=url, method='DELETE', **kwargs)
        elif method == 'PUT':
            return requests.request(url=url, method='PUT', **kwargs)

    def post(self, url, **kwargs):
        return self.request(url, 'POST', **kwargs)

    def get(self, url, **kwargs):
        return self.request(url, 'GET', **kwargs)

    def delete(self, url, **kwargs):
        return self.request(url, 'DELETE', **kwargs)

    def put(self, url, **kwargs):
        return self.request(url, 'PUT', **kwargs)
